package J_exercise;

public class J_ex11_20 {
	//11번문제
	
	
	public static void main(String[] args) 
	{
		
	//11번문제	
	System.out.println("[11번문제: 식이 유효한지 체크하고 결과값의 데이터 유형 맞게 변수선언]");
	int a11=27/13+4; 
	double b11=27/13+4.0; 
	double c11=42.7%3+18;
	boolean d11=(3<4)&&(5<8);// 유효하지않음 : /를 <로 수정
	double e11=23/5+23/5.0;
	double f11=2.0+'a';
	int g11=2+'a'; 
	int h11='a'+'b';
	int i11='a'/'b';
	boolean j11='a'!='b';
	double k11='a'/'b';

	System.out.println("boolean d11=(3<4)&&5/8;이라는 문장은 오류./를 <로 바꾸어줌");
	System.out.println("나머지는 굳이출력안함 ");
	System.out.println();
	
	//12번 문제 
	System.out.println("[12번문제: 실행결과가 무엇인지 서술]");
	int n=(int)3.9;
	System.out.println("n=="+n);
	System.out.println();
	//13번문제 
	System.out.println("[13번문제 :실행결과서술(증감연산)]");
	int n13=3;
	n13++;
	System.out.println("n=="+n13);
	n13--;
	System.out.println("n=="+n13);
	System.out.println();
	//14번문제 
	System.out.println("[14번문제 :실행결과(출력문에서 상수연산 결과차이)]");
	System.out.println("2+2="+(2+2));
	System.out.println("2+2="+2+2);
	System.out.println();
	
	//15번문제
	System.out.println("[15번문제 :실행결과(변수값 대입)]");
	char a,b;
	a='b';
	System.out.println("a="+a);
	b='c';
	System.out.println("b="+b);
	a=b;
	System.out.println("a=b 대입하면 a값은 "+a);
	System.out.println();
	
	
	//16번문제 
	System.out.println("[16번문제 :if문실행결과 변수값서술]");
	int n16=1,k16=2,r16=n16;
	
	if(k16<n16)
		r16=k16;
	System.out.println("1.n="+n16+",k="+k16+",r="+r16);
	
	n16=1;
	k16=2;
	r16=0;
	
	if(n16<k16)
		r16=k16;
	else 
		r16=k16+n16;
	
	System.out.println("2.n="+n16+",k="+k16+",r="+r16);
	
	n16=1;
	k16=2;
	r16=k16;
	
	if(r16<k16)
		n16=r16;
	else 
		k16=n16;
	
	System.out.println("n="+n16+",k="+k16+",r="+r16);
	
	
	n16=1;
	k16=2;
	r16=3;
	
	if(r16<n16+k16)
		r16=2*n16;
	else 
		k16=2*r16;
	
	System.out.println("n="+n16+",k="+k16+",r="+r16);
	System.out.println();
	
	//17번문제
	System.out.println("[17번문제 :if문잘못된것고르기]");
	int x17=0,y17=0;
	if(x17 - y17 ==0)
	{		
		x17=1;
		y17=1;
	}
	System.out.println("a) if(x&&y==0){x=1;y=1;} 에서 && 를 사칙연산으로수정");
	
	if(1<=x17&&x17<=10)
	System.out.println("if(1<=x<=10)를 if(1<=x&&x<=10)로 수정하며 이것이 출력된다");
	System.out.println();
	//18번문제 
	System.out.println("[18번문제 :number변수에 30과 35입력된다고 가정할때 if문 결과 출력 ]");
	int number=30;

	if(number%2==0){System.out.println(number+" is even");}
	else System.out.println(number+" is odd");
	
	number=35;
	
	if(number%2==0){System.out.println(number+" is even");}
	else System.out.println(number+" is odd");

	System.out.println();
	
	//19번문제 
	System.out.println("[19번문제 :변수값에 따른 if문 출력 ]");
	
	System.out.println("a.x=3,y=2");
	int x19=3,y19=2;
	if(x19>2)
	{
		if(y19>2)
		{
			int z=x19+y19;
			System.out.println("z is "+z);
		}
	}
	else
		System.out.println("x is "+x19);
	System.out.println("=>이중조건문에 만족하지못해 출력할게없다 ");
	System.out.println();
	System.out.println("b.x=3,y=4");
	
	x19=3;
	y19=4;
	if(x19>2)
	{
		if(y19>2)
		{
			int z=x19+y19;
			System.out.println("=>z is "+z+" 를 출력");
		}
	}
	else
		System.out.println("x is "+x19);
	System.out.println();
	System.out.println("b.x=2,y=2");
	
	x19=2;
	y19=2;
	if(x19>2)
	{
		if(y19>2)
		{
			int z=x19+y19;
			System.out.println("=>z is "+z+" 를 출력");
		}
	}
	else
		System.out.println("=>x is "+x19+" 를 출력");
	System.out.println();
//	20번문제
	System.out.println("[20번문제 :실행결과값출력  (증감연산조건문) ]");
	
	int a20=3;
	if(a20++==3)System.out.println("Three");
	else  System.out.println("Four");
	
	a20=3;
	if(++a20==3)System.out.println("Three");
	else  System.out.println("Four");
	
	a20=3;
	a20=a20++;
	if(a20==3)System.out.println("Three");
	else  System.out.println("Four");
	
	
	
		
	
	}//end of main
}
